package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.dto.NursingProjectDto;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zzw
 * @date 2025/6/3
 * @description
 */
@Api(tags = "小程序护理项目")
@RestController
@RequestMapping("/member/orders")
public class MemberOrdersController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;

    @GetMapping("/project/page")
    @ApiOperation(value = "分页查询护理项目")
    public TableDataInfo<NursingProject> page(@ApiParam("分页查询条件") NursingProjectDto nursingProjectDto) {
        return nursingProjectService.selectPage(nursingProjectDto);
    }

    @GetMapping("/project/{id}")
    @ApiOperation(value = "通过id查询护理项目")
    public AjaxResult getProjectById(@ApiParam(value = "护理项目id", required = true) @PathVariable Long id) {
        NursingProject nursingProject = nursingProjectService.getById(id);
        return success(nursingProject);
    }
}
